package com.xy.mainp.home.fragment.widget;

import android.view.ViewGroup;

import com.xy.mainp.model.home.android.HomeResultEntity;
import com.xy.view.recyclerview.StandardAdapter;

/**
 * Created by John on 2016/11/7.
 */

public class HomeAdapter extends StandardAdapter {
    @Override
    public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        ItemHomeView item = new ItemHomeView(parent.getContext());
        item.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        return new ItemViewHolder(item);
    }

    @Override
    public void onBindViewHolder(ItemViewHolder holder, int position) {
        super.onBindViewHolder(holder, position);
        ((ItemHomeView) holder.itemView).setData((HomeResultEntity) getItem(position));
    }
}
